home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 January: Mac OS SDK / Dev.CD Jan 96 SDK / Dev.CD Jan 96 SDK1.toast / Development Kits (Disc 1) / QuickDraw™ GX / Programming Stuff / Sample Code / Graphics Samples / viewPort Mania ƒ / viewPort Mania.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-04-10  |  17.7 KB  |  515 lines  |  [TEXT/KAHL]

  1. /**\
  2. |**| =====================================================================
  3. |**|
  4. |**|    viewPort Mania.c
  5. |**|
  6. |**|    gxViewPort Mania creates a window and attaches 6 childViewPorts to
  7. |**|    the parent gxViewPort of the window. We create a textShape and attach
  8. |**|    this gxShape to all of the childViewPorts.  This will allow the
  9. |**|    textShape to be drawn into all 6 childViewPorts simultaneously.
  10. |**|    Each of the childViewPorts has different attributes applied, which
  11. |**|    causes the textShape to be drawn in a slightly different manner in
  12. |**|    each of the childViewPorts.  
  13. |**|    
  14. |**|    The following list describes the settings of each of the childViewPorts:
  15. |**|    
  16. |**|    childViewPort 1:     textShape will be drawn in it's native geometry.
  17. |**|    childViewPort 2:     textShape will be scaled by 200% before it is drawn.
  18. |**|    childViewPort 3:     textShape will be scaled by 200% and the gxGrayPort
  19. |**|                        attribute will be applied to the childViewPort before
  20. |**|                        the textShape is drawn
  21. |**|    childViewPort 4:     textShape will be scaled by 300% in the x direction
  22. |**|    childViewPort 5:     textShape will be scaled by 300% in the y direction
  23. |**|    childViewPort 6:     textShape will be drawn through an Round Dot gxHalftone
  24. |**|    
  25. |**|    All of the previous effects for each childViewPort will be setup
  26. |**|    in the AdjustChildViewPortInfo function.
  27. |**|        
  28. |**|
  29. |**|    QuickDraw GX Libraries Used:
  30. |**|    "color library.c", "font library.c", "graphics debug library.c",
  31. |**|    "shape library.c", and "transform library.c".
  32. |**|
  33. |**|    ©1990-1994  Apple Computer, Inc.
  34. |**|    All rights reserved.
  35. |**|
  36. |**| =====================================================================
  37. \**/
  38.  
  39.  
  40. #include "graphics shell.h"
  41.  
  42.  
  43.  
  44. /**\
  45. |**| ---------------------------------------------------------------------
  46. |**| ENUMS
  47. |**| ---------------------------------------------------------------------
  48. \**/
  49. enum {    kNumberOfChildViewPorts                         = 6,
  50.         kNumberOfTextShapesToBeDrawn                 = 17,
  51.  
  52.         kSpacingBetweenChildViewPorts                 = 25,
  53.         kSpacingForTextInfoBetweenChildViewPorts     = 15,
  54.         kWidthOfAChildViewPort                         = 150,
  55.  
  56.         kTextShapeTextSize                             = 36,
  57.         kTextShapeStartingHLocation                     = 24,
  58.         kTextShapeStartingVLocation                     = 92  };
  59.  
  60.  
  61. /**\
  62. |**| ---------------------------------------------------------------------
  63. |**| GLOBALS
  64. |**| ---------------------------------------------------------------------
  65. \**/
  66. // If gDebugging = TRUE, graphics library errors and notices will be posted.  This
  67. // functionality will only work with the "debugging" version of QuickDraw GX.
  68. // If the debugging version is not installed, nothing bad will happen, but these
  69. // functions will not work. 
  70.  
  71. Boolean        gDebugging = true;
  72.  
  73. // Set  "gGiveMeValidation" to TRUE if you want receive run-time validation.
  74.  
  75. Boolean        gGiveMeValidation = true;
  76.  
  77.  
  78. // gGraphicsHeapSize sets the size of the graphics heap created by calling the
  79. // GXNewGraphicsClient routine in main () within QuickDraw GX shell.c.  You can determine
  80. // the amount of graphics heap required by using GraphicsBug.
  81.  
  82. long        gGraphicsHeapSize = 75;
  83.  
  84.  
  85.  
  86. gxShape     gTextShape;
  87. gxColor     gTextColor;
  88.  
  89. //
  90. //      Contains the list of all created viewPorts.  You need this list to enable the application to attach 
  91. //    the gTextShape to all of the child viewPorts attached to the window.
  92. //
  93. gxViewPort     gChildViewPortList[kNumberOfChildViewPorts]; 
  94. short        gTotalNumberOfTextShapesDrawn,
  95.             gDegreesOfRotation;
  96. fixed        x,y;
  97.  
  98.  
  99.  
  100. /**\
  101. |**| ---------------------------------------------------------------------
  102. |**| PROTOTYPES
  103. |**| ---------------------------------------------------------------------
  104. \**/
  105.  
  106. // funtions required by shell
  107.  
  108. void    DoInitialization        (WindowPtr wind);
  109. void    DoDraw                    (WindowPtr wind);
  110. void    DoDispose                (WindowPtr wind);
  111. void    DoClick                    (gxPoint orgMouseLoc, WindowPtr theWindow );
  112. void    DoIdle                    (WindowPtr wind);
  113.  
  114. // private functions
  115.  
  116. void    AdjustChildViewPortInfo    (gxViewPort temporaryChildViewPort, short childViewPortCounter);
  117. void     DrawInfo                (void);
  118.  
  119.  
  120.  
  121. /*------ AdjustChildViewPortInfo ------------------------------------------------------------------------*/
  122.  
  123. void    AdjustChildViewPortInfo (gxViewPort temporaryChildViewPort, short childViewPortCounter)
  124. {
  125.     gxMapping        childViewPortMapping;
  126.     gxShape            childViewPortFrame;
  127.     gxRectangle     childViewPortFrameBounds;
  128.     fixed            x,y;    
  129.     gxHalftone        theHalfTone;    
  130.  
  131.     //  NOTE: the childViewPortCounter is 0 based  
  132.     
  133.     switch (childViewPortCounter){
  134.     
  135.     //
  136.     //  childViewPort #2 : get the gxMapping of the childViewPort, and scale it by 200% 
  137.     //
  138.         case 1:    
  139.                 GXGetViewPortMapping(temporaryChildViewPort, &childViewPortMapping);
  140.                 childViewPortFrame = GXGetViewPortClip(temporaryChildViewPort);
  141.                 
  142.                 GXGetShapeBounds(childViewPortFrame, 0L, &childViewPortFrameBounds);
  143.  
  144.                 x = childViewPortFrameBounds.left + childViewPortFrameBounds.right >> 1;
  145.                 y = childViewPortFrameBounds.top + childViewPortFrameBounds.bottom >> 1;
  146.                 ScaleMapping(&childViewPortMapping, ff(2), ff(2), x, y);
  147.  
  148.                 GXSetViewPortMapping(temporaryChildViewPort, &childViewPortMapping);
  149.         
  150.                 GXDisposeShape(childViewPortFrame);    
  151.                 break;
  152.  
  153.  
  154.     //
  155.     //  childViewPort #3 : set the childViewPort with a dither level of 4 and set the gxGrayPort attribute. 
  156.     //                     get the gxMapping of the childViewPort, and scale it by 200% 
  157.     //
  158.         case 2:    
  159.                 GXSetViewPortAttributes(temporaryChildViewPort, gxGrayPort);
  160.                 GXSetViewPortDither (temporaryChildViewPort, 4);
  161.             
  162.                 GXGetViewPortMapping(temporaryChildViewPort, &childViewPortMapping);
  163.                 childViewPortFrame = GXGetViewPortClip(temporaryChildViewPort);
  164.                 
  165.                 GXGetShapeBounds(childViewPortFrame, 0L, &childViewPortFrameBounds);
  166.  
  167.                 x = childViewPortFrameBounds.left + childViewPortFrameBounds.right >> 1;
  168.                 y = childViewPortFrameBounds.top + childViewPortFrameBounds.bottom >> 1;
  169.                 ScaleMapping(&childViewPortMapping, ff(2), ff(2), x, y);
  170.  
  171.                 GXSetViewPortMapping(temporaryChildViewPort, &childViewPortMapping);
  172.         
  173.                 GXDisposeShape(childViewPortFrame);    
  174.                 break;
  175.     
  176.     //
  177.     //  childViewPort #4 : set the childViewPort with a dither level of 4.  get the gxMapping of the childViewPort, 
  178.     //                       and scale it by 300% in the x (vertical) direction. 
  179.     //
  180.         case 3:    
  181.                 GXSetViewPortDither (temporaryChildViewPort, 4);
  182.                     
  183.                 GXGetViewPortMapping(temporaryChildViewPort, &childViewPortMapping);
  184.             
  185.                 childViewPortFrame = GXGetViewPortClip(temporaryChildViewPort);
  186.                 
  187.                 GXGetShapeBounds(childViewPortFrame, 0L, &childViewPortFrameBounds);
  188.  
  189.                 x = childViewPortFrameBounds.left + childViewPortFrameBounds.right >> 1;
  190.                 y = childViewPortFrameBounds.top + childViewPortFrameBounds.bottom >> 1;
  191.                 ScaleMapping(&childViewPortMapping, ff(1), ff(3), x, y);
  192.  
  193.                 GXSetViewPortMapping(temporaryChildViewPort, &childViewPortMapping);
  194.         
  195.                 GXDisposeShape(childViewPortFrame);    
  196.                 break;
  197.  
  198.     //
  199.     //  childViewPort #5 : set the childViewPort with a dither level of 4.  get the gxMapping of the childViewPort, 
  200.     //                       and scale it by 300% in the y (horizontal) direction. 
  201.     //
  202.         case 4:    
  203.                 GXSetViewPortDither (temporaryChildViewPort, 4);
  204.                 GXGetViewPortMapping(temporaryChildViewPort, &childViewPortMapping);
  205.             
  206.                 childViewPortFrame = GXGetViewPortClip(temporaryChildViewPort);
  207.                 
  208.                 GXGetShapeBounds(childViewPortFrame, 0L, &childViewPortFrameBounds);
  209.  
  210.                 x = childViewPortFrameBounds.left + childViewPortFrameBounds.right >> 1;
  211.                 y = childViewPortFrameBounds.top + childViewPortFrameBounds.bottom >> 1;
  212.                 ScaleMapping(&childViewPortMapping, ff(3), ff(1), x, y);
  213.  
  214.                 GXSetViewPortMapping(temporaryChildViewPort, &childViewPortMapping);
  215.         
  216.                 GXDisposeShape(childViewPortFrame);    
  217.                 break;
  218.     
  219.     //
  220.     //  childViewPort #6 : set the childViewPort with an gxRoundDot gxHalftone in gxHsvSpace 
  221.     //
  222.         case 5:    
  223.                 theHalfTone.angle         = ff(6);
  224.                 theHalfTone.frequency     = ff(24);
  225.                 theHalfTone.method         = gxRoundDot;
  226.                 theHalfTone.tinting     = gxComponent2Tint;
  227.              
  228.                  theHalfTone.tintSpace                                 = gxCMYKSpace;   
  229.                 theHalfTone.backgroundColor.space                     = gxHSVSpace;
  230.                 theHalfTone.backgroundColor.profile                 = nil;
  231.                 theHalfTone.backgroundColor.element.hsv.value         = 0xFFFF;
  232.                  theHalfTone.backgroundColor.element.hsv.saturation     = 0xCCCD;
  233.                  theHalfTone.backgroundColor.element.hsv.hue         = 0x8000;
  234.     
  235.                 theHalfTone.dotColor.space                             = gxHSVSpace;
  236.                 theHalfTone.dotColor.profile                         = nil;
  237.                 theHalfTone.dotColor.element.hsv.value                 = 0xFFFF;
  238.                 theHalfTone.dotColor.element.hsv.saturation         = 0xAD1C;
  239.                 theHalfTone.dotColor.element.hsv.hue                 = 0xE4F9;
  240.     
  241.                 GXSetViewPortHalftone(temporaryChildViewPort, &theHalfTone);
  242.                 break;
  243.     
  244.         default:    break;
  245.     }
  246. }
  247.  
  248.  
  249.  
  250. /*------ DoInitialization ---------------------------------------------------------------------------------*/
  251.  
  252. void DoInitialization (WindowPtr wind)
  253. {
  254.     gxShape            childViewPortShape;
  255.      gxRectangle     textBoundsShape; 
  256.     gxViewPort        windowViewPortParent, temporaryChildViewPort;
  257.      short            childViewPortCounter;
  258.     fixed             childViewPortLeftEdge = kSpacingBetweenChildViewPorts, childViewPortTopEdge = kSpacingBetweenChildViewPorts, 
  259.                     childViewPortRightEdge = kWidthOfAChildViewPort + kSpacingBetweenChildViewPorts,  
  260.                     childViewPortBottomEdge = kWidthOfAChildViewPort + kSpacingBetweenChildViewPorts;
  261.     
  262.     gTotalNumberOfTextShapesDrawn = 0;
  263.     gDegreesOfRotation = 22;
  264.     
  265.     InitCommonColors ();
  266.     
  267.     //
  268.     //     Get the gxViewPort parent for the current window.  We need this gxViewPort ot allow us to attach
  269.     //    all of the childViewPorts to.  
  270.     //
  271.     windowViewPortParent = GXGetWindowViewPort(wind);
  272.  
  273.     //
  274.     //  Create the childViewPort and attach it to the parentViewPort of the current window   
  275.     //
  276.     for (childViewPortCounter = 0;  childViewPortCounter < kNumberOfChildViewPorts; childViewPortCounter++)
  277.       {
  278.           gxRectangle    viewBox;
  279.         
  280.         viewBox.left  = ff(childViewPortLeftEdge);
  281.         viewBox.top = ff(childViewPortTopEdge);
  282.         viewBox.right = ff(childViewPortRightEdge);
  283.         viewBox.bottom = ff(childViewPortBottomEdge);
  284.         
  285.         childViewPortShape = GXNewRectangle(&viewBox);
  286.  
  287.         temporaryChildViewPort =  GXNewViewPort(gxScreenViewDevices);
  288.         
  289.         //
  290.         //  Set the "new" childViewPort to the parentViewPort;  Also, set it's clip gxShape and gxMapping 
  291.         //
  292.         GXSetViewPortParent(temporaryChildViewPort, windowViewPortParent);
  293.         GXSetViewPortClip(temporaryChildViewPort, childViewPortShape);
  294.         GXSetViewPortMapping(temporaryChildViewPort, nil);
  295.  
  296.         //
  297.         //  Change the current childViewPort's attributes for aome excitement(?)
  298.         //
  299.         AdjustChildViewPortInfo (temporaryChildViewPort, childViewPortCounter);  
  300.         
  301.         gChildViewPortList[childViewPortCounter] = temporaryChildViewPort;
  302.     
  303.         childViewPortLeftEdge = childViewPortRightEdge + kSpacingBetweenChildViewPorts;
  304.         childViewPortRightEdge = childViewPortLeftEdge + kWidthOfAChildViewPort;
  305.         
  306.         if (childViewPortCounter == 2) {
  307.             childViewPortLeftEdge = kSpacingBetweenChildViewPorts;
  308.             childViewPortTopEdge = childViewPortBottomEdge + kSpacingBetweenChildViewPorts + kSpacingForTextInfoBetweenChildViewPorts;
  309.             childViewPortRightEdge = kWidthOfAChildViewPort + kSpacingBetweenChildViewPorts;
  310.             childViewPortBottomEdge = childViewPortTopEdge + kWidthOfAChildViewPort;        
  311.         }
  312.     
  313.         GXDisposeShape(childViewPortShape);    
  314.       }
  315.  
  316.  
  317.     //
  318.     //     Set up an HSV gxColor space to run the text through...  
  319.     //
  320.     gTextColor.space                     = gxHSVSpace;
  321.     gTextColor.profile                     = nil;
  322.     gTextColor.element.hsv.hue             = 0xFFFF;
  323.     gTextColor.element.hsv.value         = 0xFFFF;
  324.     gTextColor.element.hsv.saturation     = 0xFFFF;
  325.  
  326.     //
  327.     //  Set the gTextShape's: text string content, the gxFont, and size 
  328.     //
  329.     gTextShape = GXNewText(6,(unsigned char*)"Moof!!",  nil);
  330.     SetShapeCommonFont(gTextShape, timesFont);
  331.     GXSetShapeTextSize(gTextShape, ff(kTextShapeTextSize));
  332.  
  333.     //
  334.     //  Move the gTextShape into the middle of the childViewPort, and attach the gxShape to all of the childViewPorts in the window. 
  335.     //
  336.     GXMoveShapeTo(gTextShape, ff(kTextShapeStartingHLocation),  ff(kTextShapeStartingVLocation));
  337.     GXSetShapeViewPorts(gTextShape, kNumberOfChildViewPorts, gChildViewPortList);
  338.  
  339.     //
  340.     //  Get the bounds of the gTextShape, and the location of the center of  gTextShape. x & y will be used to in the 
  341.     //   GXRotateShape call in the DoDraw functions to make the text rotate around it's center.  
  342.     //
  343.     GXGetShapeBounds(gTextShape, 0L, &textBoundsShape);  
  344.     x = textBoundsShape.left + textBoundsShape.right >> 1;
  345.     y = textBoundsShape.top + textBoundsShape.bottom >> 1;
  346.  
  347.     GXSetShapeAttributes (gTextShape, gxMapTransformShape | GXGetShapeAttributes(gTextShape));
  348. }
  349.  
  350.  
  351.  
  352. /*------ DoDraw ---------------------------------------------------------------------------------------*/
  353.  
  354. void DoDraw (WindowPtr wind)
  355. {
  356.     short        drawViewPortFrameLoop;
  357.     
  358.     if (gTotalNumberOfTextShapesDrawn == 0 || gTotalNumberOfTextShapesDrawn ==  kNumberOfTextShapesToBeDrawn) {
  359.     
  360.         //
  361.         //  Get the frame gxShape from each child gxViewPort, and draw the frame.  
  362.         //
  363.         for (drawViewPortFrameLoop = 0; drawViewPortFrameLoop < kNumberOfChildViewPorts;  drawViewPortFrameLoop++) 
  364.          {
  365.             gxShape    childViewPortFrame;
  366.         
  367.             childViewPortFrame = GXGetViewPortClip(gChildViewPortList [drawViewPortFrameLoop]);
  368.         
  369.             //
  370.             //  Let's erase the contents of the this childViewPort 
  371.             //
  372.             SetShapeCommonColor (childViewPortFrame,gxWhite);
  373.             GXDrawShape (childViewPortFrame);
  374.  
  375.             //
  376.             //  Let's redraw the frame of the current childViewPort.  Set the gxShape's fill to be a frame, set the gxColor,
  377.             //  set the pen thickness, and set the gxStyle attributes to draw the frame on the outside of the childViewPortFrame
  378.             //  gxShape. This prevents the frame from falling a few pixels within the bounds of the childViewPort.                          **/
  379.             //
  380.             GXSetShapeStyleAttributes(childViewPortFrame, gxOutsideFrameStyle);
  381.             GXSetShapeFill (childViewPortFrame,  gxClosedFrameFill); 
  382.             SetShapeCommonColor (childViewPortFrame, gxBlack);
  383.             GXSetShapePen(childViewPortFrame, ff(2)); 
  384.             GXDrawShape (childViewPortFrame);
  385.             GXDisposeShape(childViewPortFrame);    
  386.         }
  387.             
  388.         //
  389.         //     Draw the text information below each childViewPort
  390.         //
  391.         DrawInfo (); 
  392.     }
  393.  
  394.  
  395.     if (gTotalNumberOfTextShapesDrawn ==  kNumberOfTextShapesToBeDrawn) {
  396.         
  397.         //
  398.         //   The text  has been rotated 360 degrees. Let's  reset the gxShape's gxTransform. By resetting the gxTransform 
  399.         //    will reset the gxTransform back to the GX default gxTransform (i.e. no rotate). 
  400.         //
  401.         //    With the call to GXRotateShape below, we have been only effecting the gxShape's gxTransform 
  402.         //    instead of the gxShape's geometry because we had set the gxMapTransformShape attribute above. When we reset
  403.         //    the tranform of our text gxShape, we need to also reset the gxViewPort because the GXResetTransform call
  404.         //    also resets the gxViewPort list.
  405.         //
  406.         GXResetTransform(GXGetShapeTransform(gTextShape));
  407.         GXSetShapeViewPorts(gTextShape, kNumberOfChildViewPorts, gChildViewPortList);
  408.  
  409.  
  410.         gDegreesOfRotation = -gDegreesOfRotation;
  411.         gTotalNumberOfTextShapesDrawn = 0;
  412.     }
  413.     
  414.     GXSetShapeColor(gTextShape, &gTextColor);
  415.     GXDrawShape(gTextShape);
  416.     
  417.     gTextColor.element.hsv.hue -= 0x0600;
  418.  
  419.     GXRotateShape(gTextShape, ff(gDegreesOfRotation), x, y);
  420.         
  421.     gTotalNumberOfTextShapesDrawn++;
  422. }
  423.  
  424.  
  425.  
  426. /*------ DrawInfo --------------------------------------------------------------------------------------*/
  427. //
  428. //    This functions draws the text information below each childViewPort.   
  429. //
  430. void DrawInfo (void)
  431. {
  432.     gxShape        textTitleShape;
  433.     gxPoint        textLocation;
  434.  
  435.     //
  436.     //    We want to reset various attributes of the text as we move our messages around under the various ViewPort.
  437.     //
  438.     GXIgnoreGraphicsNotice(text_size_already_set);
  439.     
  440.     //
  441.     //  Create the textTitleShape, by setting the: Font, size, and starting location...  
  442.     //
  443.     textLocation.x = ff(60);    textLocation.y = ff(190);
  444.     textTitleShape = GXNewText(14, (unsigned char*)"original Shape",  &textLocation);
  445.     SetShapeCommonFont(textTitleShape, timesFont);
  446.     GXSetShapeTextSize(textTitleShape, ff(12));
  447.     GXDrawShape (textTitleShape);
  448.  
  449.     //
  450.     //  Change the textTitleShape for the next message...
  451.     //
  452.     textLocation.x = ff(240);       
  453.     GXSetText(textTitleShape, 12, (unsigned char*)"200% Scaling", &textLocation);
  454.     GXDrawShape (textTitleShape);
  455.  
  456.  
  457.     textLocation.x = ff(365);       
  458.     GXSetText(textTitleShape, 34, (unsigned char*)"200% Scaling with a gray attribute", &textLocation);
  459.     GXDrawShape (textTitleShape);
  460.  
  461.     textLocation.x = ff(17);  textLocation.y = ff(380);
  462.     GXSetText(textTitleShape, 31, (unsigned char*)"300% Scaling in the x direction", &textLocation);
  463.     GXDrawShape (textTitleShape);
  464.  
  465.     textLocation.x = ff(195);     
  466.     GXSetText(textTitleShape, 31, (unsigned char*)"300% Scaling in the y direction", &textLocation);
  467.     GXDrawShape (textTitleShape);
  468.  
  469.     textLocation.x = ff(370);     
  470.     GXSetText(textTitleShape,30, (unsigned char*)"Round Dot Halftone in HSVSpace", &textLocation);
  471.     GXDrawShape (textTitleShape);
  472.  
  473.     GXDisposeShape (textTitleShape);
  474.     
  475.     //
  476.     //    We need to balance all of our GXIgnoreGraphicsNotice calls with GXPopGraphicsNotice calls,
  477.     //    thereby preventing the notice stack from overflowing.'
  478.     //
  479.     GXPopGraphicsNotice(); 
  480. }
  481.  
  482.  
  483.  
  484. /*------ DoDispose -------------------------------------------------------------------------------------*/
  485.  
  486. void DoDispose (WindowPtr wind)
  487. {
  488.     //  
  489.     //    You should always dispose of your GX graphics objects before tossing your window. Why? It's generally good 
  490.     //    form and this approach guarantees that everything is disposed. If you had not disposed of everything, the
  491.     //    call to DisposeWindow should dispose of the objects. If you are running the debugging version of the 
  492.     //    SecretGraphics init with notices set, you will receive a notice that you had not disposed of everything. You
  493.     //    can turn notices on in this file by setting gDebugging = TRUE (above).
  494.     //  
  495.      GXDisposeShape(gTextShape);  
  496.     DisposeCommonColors();  
  497.       DisposeWindow(wind);
  498.  }
  499.     
  500.  
  501.  
  502. /*------ DoClick ---------------------------------------------------------------------------------------*/
  503.  
  504. void DoClick (gxPoint orgMouseLoc, WindowPtr theWindow )
  505. {
  506. }
  507.  
  508.  
  509. /*------ DoIdle ----------------------------------------------------------------------------------------*/
  510.  
  511. void DoIdle (WindowPtr wind)
  512. {
  513.     DoDraw(wind);
  514. }
  515.